//
//  IOosObjects.h
//  oos4ios
//
//  Created by Pablo Gonzalez on 3/2/11.
//

#import "OosPrivacy.h"
#import "OosLocation.h"
#import "OosService.h"
#import "OosObject.h"

/**
 This protocol is based on the Atom/Service mapping that can be found at:
 https://services.google.com/service/api11870/api/atom-mappings/service-atom-mapping
 Here the object Service is renamed to service to avoid comfusion with the atom services.
 */
@interface OosService : OosObject

+ (OosService *) serviceFromSlug;

/**
 Returns the name of the oos service. Maps to <atom:title>
 */
@property (nonatomic, retain) NSString *name;
/**
 Returns a snippet of the review given by the user. Maps to <atom:summary>
 */
@property (nonatomic, retain) NSString *reviewSnippet;
/**
 Returns the Privacy level for the service.
 Maps to <atom:category schema="http://api.11870.com/api/v2/privacy">
 */
@property (nonatomic, retain) OosPrivacy *privacy;
/**
 Returns an array with the tags used by users in the service (not all are returned)
 If the service is a saved service. These tags are the provided by the user.
 Maps to <atom:category schema="http://api.11870.com/api/v2/tag">
 */
@property (nonatomic, retain) NSArray *tags;
- (void) addTag: (NSString *) tag;
- (void) removeTag: (NSString *) tag;
/**
 User lists (groups) assigned to a service. 
 Maps to <atom:category schema="http://api.11870.com/api/v2/list">
 */
@property (nonatomic, retain) NSArray *lists;
- (void) addList: (NSString *) list;
- (void) removeList: (NSString *) list;
/**
 Categories assigned by 11870.com (Read-Only).
 Maps to <atom:category schema="http://api.11870.com/api/v2/categories">
 */
@property (nonatomic, retain) NSArray *categories;
- (void) addCategory: (NSString *) category;
- (void) removeCategory: (NSString *) category;
/**
 Attributes assigned by 11870.com (Read-Only).
 Maps to <atom:category schema="http://api.11870.com/api/v2/attibutes">
 */
@property (nonatomic, retain) NSArray *attributes;
- (void) addAttribute: (NSString *) attribute;
- (void) removeAttribute: (NSString *) attribute;
/**
 Permalink:
 For search results: service url. 
 For user addressbook it is the review url.
 Maps to <atom:link rel="alternate">
 */
@property (nonatomic, retain) NSString *permalink;
/**
 Url for the service inside the api
 Maps to <atom:link rel="service">
 */
@property (nonatomic, retain) NSString *serviceUrlString;
/**
 Same as serviceUrlString: but parsing it as a NSURL
 */
@property (nonatomic, retain) NSURL *serviceUrl;
/**
 Url for the media in the service (Addressbook-Only)
 Maps to <atom:link rel="media">
 */
@property (nonatomic, retain) NSString *mediaUrlString;
@property (nonatomic, retain) NSURL *mediaUrl;
/**
 Identifier of the service in 11870.com database.
 Maps to <oos:id>
 */
@property (nonatomic, retain) NSString *oosId;
/**
 String identifier for a service. It is used for obtaining 
 the url of a service either in the api or in the web.
 Maps to <oos:slug>
 */
@property (nonatomic, retain) NSString *slug;
/**
 The url of the webservice of the service.
 Maps to <oos:url>
 */
@property (nonatomic, retain) NSString *url;
/**
 The telephone of the service.
 Maps to <oos:telephone>
 */
@property (nonatomic, retain) NSString *telephone;
/**
 The number of review this service has.
 Maps to <oos:reviews-counter>
 */
@property (nonatomic, retain) NSNumber *reviewCount;
/**
 The number of people that saved this service.
 Maps to <oos:saved-counter>
 */
@property (nonatomic, retain) NSNumber *savedCount;
/**
 The users that has saved this site. (Search-Only)
 */
@property (nonatomic, retain) NSArray *savedBy;
/**
 Average rating given to the user.
 */
@property (nonatomic, retain) NSNumber *rating;
/**
 An object representing the location of the service
 */
@property (nonatomic, retain) OosLocation *location;
/**
 Link to estimates service, to send leads to a professional.
 Maps from <oos:lead-service>
 */
@property (nonatomic, retain) NSURL *leadService;
@property (nonatomic, retain) NSString *leadServiceString;

@property (nonatomic, retain) NSDate *updated;

@end